* Appendix
**# get data using your directory information
	cd "" 
	use "CFDIAS_data.dta", clear
	
**# Create Table A1: Replicates Table 2 from the main text but using country effects instead of regions
	* Define Covariates
	global covfe llnfdinetinflows2 lWDIGDPGrPer2 lBITChinForce2 lWDITradePerGDP2 ///
	lexecrlc2 lTotNatResRentPerGDP2 lMarshactotalD2 llnVDemv2x_rule2 ///
	llnVDemv2x_libdem2 llnWDIGDP2 lka_open2 llndurable2 lUSFDIBEAPGDP2 
	
	* generate weights with ebalance
	ebalance SanBal $covfe, gen(weightfe)
	drop if weightfe==.
	
	* Create Table A1
	est clear
	reg lnSOE SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode) 
	eststo m1
		
	reg lnPOE SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode)
	eststo m2
	
	reg  lnSOE_E SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode)
	eststo m3
		
	reg lnPOE_E SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode)
	eststo m4
	
	reg lnSOE_NE SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode)
	eststo m5
	
	reg lnPOE_NE SanUS ThUS $covfe i.ccode i.year [aweight=weightfe], cluster(ccode)
	eststo m6
		
	esttab, bic replace onecell nogap obslast star(* .1 ** .05 *** .01) label  b(2) t(2) 

	* Can also create a similar version of Table A1 using reghdfe 
	est clear
	reghdfe lnSOE SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode)
	eststo m1
		
	reghdfe lnPOE SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode) 
	eststo m2

	reghdfe lnSOE_E SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode)
	eststo m3

	reghdfe lnPOE_E SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode)
	eststo m4
 
	reghdfe lnSOE_NE SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode) 
	eststo m5

	reghdfe lnPOE_NE SanUS ThUS $covfe [aweight=weightfe], absorb(ccode year) cluster(ccode) 
	eststo m6
	
	esttab, bic replace onecell nogap obslast star(* .1 ** .05 *** .01) label  b(2) t(2) 

**# Table A2: (EU, U.S., and China in same model)
	use "CFDIAS_data.dta", clear
	
	* Define Covariates	
	global cov llnfdinetinflows2 lWDIGDPGrPer2 lBITChinForce2 lWDITradePerGDP2 ///
	lexecrlc2 lTotNatResRentPerGDP2 lMarshactotalD2 llnVDemv2x_rule2 ///
	llnVDemv2x_libdem2 llnWDIGDP2 lka_open2 llndurable2 lUSFDIBEAPGDP2 ///
	asia eeurop lamerica nafrme
	
	* generate weights with ebalance
	ebalance SanBal $cov, gen(weight)
	drop if weight==.

	* Create Table A2 
	est clear
	reg lnSOE SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m1
	
	reg lnPOE SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m2

	reg lnSOE_E SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m3
	
	reg lnPOE_E SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m4
	
	reg lnSOE_NE SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m5
	
	reg lnPOE_NE SanEU SanUS ThEU ThUS SanThChin $cov i.year [aweight=weight], cluster(ccode)
	eststo m6
		
	esttab, bic replace onecell nogap obslast star(* .1 ** .05 *** .01) label  b(2) t(2) 
	
**# Table A3: No Controls. balance on regions 
	use "CFDIAS_data.dta", clear
	
	* Define Covariates	
	global cov2 asia eeurop lamerica nafrme
	
	* generate weights with ebalance
	ebalance SanBal $cov2, gen(weight)
	drop if weight==.
		
	* Create Table A3
	est clear
	reg lnSOE SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m1
	
	reg lnPOE SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m2
	
	reg  lnSOE_E SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m3
	
	reg lnPOE_E  SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m4
	
	reg lnSOE_NE SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m5
	
	reg lnPOE_NE SanUS ThUS $cov2 i.year [aweight=weight], cluster(ccode)
	eststo m6
	
	esttab, bic replace onecell nogap obslast star(* .1 ** .05 *** .01) label  b(2) t(2) 

